<template>
  <div>
    <h2>名称：{{ name }}</h2>
    <h2>地址：{{ address }}</h2>
    <button @click="sendPublish">BTN</button>
  </div>
</template>

<script>
import pubsub from "pubsub-js";
export default {
  name: "Student",
  data() {
    return {
      name: "zhangsan",
      address: "china",
    };
  },
  methods: {
    sendPublish() {
      pubsub.publish("hello",111);
    },
  },
};
</script>

<style>
</style>